package com.fjxd.user.web;

import com.fjxd.feign.result.ViewResult;
import com.fjxd.user.pojo.User;
import com.fjxd.user.service.LoginService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class LoginController {
    @Autowired
    private LoginService loginService;

    @PostMapping("login")
    public ViewResult getUser(@RequestBody User user){
        System.out.println(user.getUsername());
        return loginService.findUserByUserAndPwd(user);

    }

}